Data mining is the exploration and analysis of large quantities of data, in order to discover correlations, patterns, and trends in the data. Data mining may also be used to create models that can be used to predict future data or classify existing data.
For example, a business may amass a large collection of information about its customers. This information may include purchasing information and any other information available to the business about the customer. The predictions of a model associated with customer data may be used, for example, to control customer attrition, to perform credit-risk management, to detect fraud, or to make decisions on marketing.
To create and test a data mining model such as a decision tree, available data may be divided into two parts. One part, the training data set, may be used to create models. The rest of the data, the testing data set, may be used to test the model, and thereby determine the performance of the model in making predictions. Data within data sets is grouped into cases. For example, with customer data, each case corresponds to a different customer. All data in the case describes or is otherwise associated with that customer.
One type of predictive model is the decision tree. Decision trees are used to classify cases with specified input attributes in terms of an output attribute. Once a decision tree is created, it can be used predict the output attribute of a given case based on the input attributes of that case.
Decisions trees are composed of nodes and leaves. One node is the root node. Each node has an associated attribute test that splits cases that reach that node to one of the children of the node based on an input attribute. The tree can be used to predict a new case by starting at the root node and tracing a path down the tree to a leaf, using the input attributes of the new case in the attribute tests in each node. The path taken by a case corresponds to a conjunction of attribute tests in the nodes. The leaf contains the decision tree's prediction for the output attribute(s) based on the input attributes.
An exemplary decision tree is shown in FIG. 1. In this decision tree, or example, if a decision tree is being used to predict a customer's credit risk, input attributes may include debt level, employment, and age, and the output attribute is a prediction of what the credit risk for the customer is. As shown in FIG. 1, decision tree 200 consists of root node 210, node 212, and leaves 220, 222 and 224. The input attributes are debt level and type of employment, and the output attribute is credit risk. Each node has associated with it a split constraint based on one of the input attributes. For example, the split constraint of root node 210 is whether debt level is high or low. Cases where the value of the debt input attribute is “high” will be transferred to leaf 224 and all other cases will be transferred to node 212. Because leaf 224 is a leaf, it gives the prediction the decision tree model will give if a case reaches leaf 224. For decision tree 200, all cases with a “high” value for the debt input attribute will have credit risk output attribute assigned to “bad” with a 100% probability. The decision tree 200 in FIG. 1 predicts only one output attribute, however more than one output attribute may be predicted with a single decision tree.
While the decision tree may be displayed and stored in a decision tree data structure, it may also be stored in other ways, for example, as a set of rules, one for each leaf node, containing a conjunction of the attribute tests.
Attributes for use as input attributes and output attributes can be n-state attributes. However, when the possible values for an attribute are continuous rather than falling in one of a predetermined number of states, the use of the attribute becomes complicated. For example, income data may be continuous, with an exact income number (e.g. $354,441.30) supplied in the data being used, rather than having a number of income states.
In order to create the tree, the nodes, attribute tests, and leaf values must be decided upon. Generally, creating a tree is an inductive process. Given an existing tree, all testing data is processed by the tree, starting with the root node, divided according to the attribute test to nodes below, until a leaf is reached. The data at each leaf is then examined to determine whether and how a split should be performed, creating a node with an attribute test leading to two leaf nodes in place of the leaf node. This is done until the data at each node is sufficiently homogenous. In order to begin the induction the root node is treated as a leaf.
To determine whether a split should be performed, a score gain is calculated for each possible attribute test that might be assigned to the node. This score gain corresponds to the usefulness of using that attribute test to split the data at that node. There are many ways to determine which attribute test to use using the score gain. For example, the decision tree may be built by using the attribute test that reduces the amount of entropy at the node. Entropy is a measure of the homogeneity of the data. The data at the node must be split into two groups of data which each are heterogeneous from each other.
In order to determine what the usefulness is of splitting the data at the node with a specific attribute test, the resultant split of the data at the node for each output attribute must be computed. This correlation data is used to determine a score which is used to select an attribute test for the node. Where the input attribute being considered is gender, for example, and the output attribute is car color, the data from the following Table 1 must be computed for the testing data that reaches the node being split:
TABLE 1Correlation Count Tablegender = MALEgender ≠ MALEcar color = RED359503car color ≠ RED49033210
As described above, data in a correlation count table such as that shown in Table 1 must be calculated for each combination of a possible input attribute test and output attribute description. This means that not only must the gender input attribute be examined to see how it splits the data at the node into red cars and non-red cars, but it must also examine how the gender input attribute splits the data at the node into blue cars and non-blue ones, green cars and non-green ones, etc., for every possible state of the “car color” variable.
In order to use a continuous attribute as an input attribute, correlation count table data must be produced. However, for the continuous attribute, calculating a correlation count table for each value of the continuous attribute would produce little useful information and be so computationally expensive as to be infeasible. Clearly, some way to handle continuous attributes to determine correlation count table calculations is required or such attributes can not be used as input attributes for a decision tree.
In the prior art, a method is used to discretize the values of a continuous attribute into a pre-determined number of ranges (e.g. four). This is done by finding one or more “cut point” values in the range of the continuous attribute. Thus, for a continuous attribute with values ranging from AMIN to AMAX, a cut point CP1 is determined. This divides the attribute into two ranges—AMIN–CP1 and CP1–AMAX. Doing this once more on each of the resultant ranges yields four ranges—AMIN–CP2, CP2–CP1, CP1–CP3, and CP3–AMAX. These ranges are determined by analyzing the sample data to determine the cut point with the best discretization based on the entropy of the data when divided at different possible cut points.
Once these ranges are determined, they are used as states of the attribute for the purpose of determining correlation counts and comparing attribute tests for use at a node. However, this sampling and discretization process requires an actual scan of the entire set of cases, sorting of the cases, and repetitive calculation of entropy over the possible ranges created by selecting different cut points. The determination of cut points is done relative to each node and so must be performed for each node. This involves high memory space and processing requirements. Additionally, the pre-determined number of ranges may not be appropriate for the data in all portions of the tree. For example, it may be better (in terms of tree score or prediction accuracy) to consider five logical ranges for the data, and information may be lost which otherwise would have been useful in making predictions. Using more cut points increases the number of ranges for which a correlation table must be constructed and evaluated, however, and therefore the computational overhead is also increased.
Because of the computational expense of determining cut points, and the loss of information associated with the prior art technique, attributes with a range of possible values are problematic. Using a continuous attribute as an input attribute can be resource intensive and may not capture much of the information contained in that attribute for the purposes of predicting the class attribute.
Thus, there is a need for a technique to allow the use of continuous attributes as input attributes in decision trees, with increased flexibility and reduced time and space requirements.